﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace App.Cache
{
    public interface IRedisClientService
    {
        Task<int> CountAsync<T>(string keyPattern);
        Task DelAsync(string key);
        Task DelHashAsnyc(string key, string[] fields);
        Task<T> GetAsync<T>(string key);
        Task<Dictionary<string, T>> GetHashAllAsync<T>(string key);
        Task<T> GetHashAsync<T>(string key, string field);
        Task<string[]> GetHKeys();
        Task<T> LIndexAsync<T>(string key, int index);
        Task<bool> HashExsitAsync(string key, string field);
        Task<int> HIncrAsync(string key, string field, int num);
        Task RPushAsync(string key, object value);
        Task SetAsync<T>(string key, T item, TimeSpan expiration);
        Task SetAsync<T>(string key, T item, int seconds);
        Task SetHashAsync(string key, string field, object value);
        Task SetListAsync(string key, long index, object value);
        T LIndex<T>(string key, int index);
        long LLen(string key);
    }
}